package com.xike.microemailserver.config;

/*
 * @author: masterhai
 * @date: 2021/4/8:10:02
 * @description:
 */

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson配置类
 * 主要提供：Redis分布式锁的功能
 */
@Configuration
public class RedissonConfiguration {
    /**
     * 根据配置信息，产生一个Redisson的客户端对象
     * @return
     */
    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://106.13.1.48:6379");
        return Redisson.create(config);
    }
}
